package com.xunk.scene.domain;

import com.xunk.common.core.utils.StringUtils;
import com.xunk.scene.enums.ExecutionResultEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ProjectName: HIM
 * @Package: com.xunk.scene.domain
 * @ClassName: PeriodSceneResultEntity
 * @Author: luanzhiwei
 * @Description: 场景执行结果区间记录实体类
 * @Date: 2021/6/23 17:16
 * @Version: 1.0
 */
@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode
public class PeriodSceneResultEntity {
    /**
     * id
     */
    private Long id;
    /**
     * 场景id
     */
    private Long sceneId;
    /**
     * 场景名称
     */
    private String sceneName;
    /**
     * 家庭id
     */
    private Long homeId;
    /**
     * 执行结果代码
     */
    private String result;
    /**
     * 执行结果描述
     */
    private String resultName;
    /**
     * 展示日期
     */
    private String showDate;
    /**
     * 展示时间
     */
    private String showTime;

    public String getResultName() {
        return StringUtils.isEmpty(result) ? StringUtils.EMPTY : ExecutionResultEnum.getDescByCode(result);
    }

    public void setResultName(String resultName) {
        this.resultName = StringUtils.isEmpty(resultName) ? StringUtils.EMPTY : ExecutionResultEnum.getDescByCode(result);
    }
}
